<template>
    <div class="export-page">
       <div class="export-content">

         <chart1 name="技术发展趋势网络趋势" category="news"  keyName="technologyDevelopmentTrendsNews"></chart1>
         <chart1 name="技术发展趋势论文趋势" category="paper"  keyName="technologyDevelopmentTrendsPaper"></chart1>
         <chart1 name="技术发展趋势专利趋势" category="patent"  keyName="technologyDevelopmentTrendsPatent"></chart1>

         <chart2 name="技术动态信息网络来源排名" category="news" keyName="technologySourceDistributionNews"></chart2>
         <chart2 name="技术动态信息论文来源排名"  category="paper" keyName="technologySourceDistributionPaper"></chart2>
         <chart2 name="技术动态信息专利来源排名"  category="patent" keyName="technologySourceDistributionPatent"></chart2>

         <chart3 category="news" keyName="technologyRegionalDistribution"></chart3>

         <chart4 name="技术热点网络热词排名" category="news" keyName="technologyHotspotNews"></chart4>
         <chart4 name="技术热点论文热词排名" category="paper" keyName="technologyHotspotPaper"></chart4>
         <chart4 name="技术热点专利热词排名" category="patent" keyName="technologyHotspotPatent"></chart4>

         <chart5 name="技术热点网络热词趋势" category="news" keyName="hotWordDevelopmentTrendNews"></chart5>
         <chart5 name="技术热点论文热词趋势" category="paper" keyName="hotWordDevelopmentTrendPaper"></chart5>
         <chart5 name="技术热点专利热词趋势" category="patent" keyName="hotWordDevelopmentTrendPatent"></chart5>

         <chart6 name="技术热点网络热词图谱" category="news" keyName="hotWordsAtlasNews"></chart6>
         <chart6 name="技术热点论文热词图谱" category="paper" keyName="hotWordsAtlasPaper"></chart6>
         <chart6 name="技术热点专利热词图谱" category="patent" keyName="hotWordsAtlasPatent"></chart6>

         <chart7 name="技术热点网络热词共现" category="news" keyName="coWordAnalysisNews"></chart7>
         <chart7 name="技术热点论文热词共现" category="paper" keyName="coWordAnalysisPaper"></chart7>
         <chart7 name="技术热点专利热词共现" category="patent" keyName="coWordAnalysisPatent"></chart7>

         <chart8 name="重点机构排名"  keyName="importantOrgList"></chart8>

         <chart10 name="机构合作网络"  keyName="allOrgCooperateNet"></chart10>

         <chart11 name="机构网络动态" category="news"  keyName="orgTechEventDetailsNews"></chart11>
         <chart11 name="机构论文动态" category="paper"  keyName="orgTechEventDetailsPaper"></chart11>
         <chart11 name="机构专利动态" category="patent"  keyName="orgTechEventDetailsPatent"></chart11>

         <chart12 name="重点专家排名"  keyName="importantAuthorList"></chart12>

         <chart14 name="专家网络动态" category="news"  keyName="authorTechEventDetailsNews"></chart14>
                  <chart14 name="专家论文动态" category="paper"  keyName="authorTechEventDetailsPaper"></chart14>
                  <chart14 name="专家专利动态" category="patent"  keyName="authorTechEventDetailsPatent"></chart14>
       </div>
    </div>
</template>

<script>
    import event from '../event.js';
    import {chart1,chart2,chart3,chart4,chart5,chart6,chart7,chart8,chart10,chart11,chart12,chart14} from '../exportchart/index.js'
    export default {
        components:{
          chart1,chart2,chart3,chart4,chart5,chart6,chart7,chart8,chart10,chart11,chart12,chart14
        },
        name: "exportview",
        mounted() {
          event.$on('export',()=>{
              this.export()

          })
        },
        methods: {
          export() {
            let promiseList = [];
            let keyName = [];
            this.$children.forEach(chart =>{
               promiseList.push(chart.getDataURL());
               keyName.push(chart.$el.getAttribute('keyName'));
            });

            Promise.all(promiseList).then((res)=>{
              let query = {};
              keyName.forEach( (key,_index) => {
                query[key] = res[_index];
              });
              this.api({
                url: 'statistical/imgData',
                method: "post",
                data:this.$qs.stringify(query)
              }).then(data => {
                 console.log(data)
              });

            });
          }
        },
    }
</script>

<style lang="scss" scoped>

</style>

